package com.fuzongle.tankboot.service;

import com.fuzongle.tankboot.common.annotation.DataSource;
import com.fuzongle.tankboot.common.enums.DataSourcesType;
import com.fuzongle.tankboot.entity.Test;
import com.fuzongle.tankboot.mapper.TestMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther: fuzongle
 * @Date: 2020/6/8 10:49
 * @Description:
 */
@Service
public class TestService {

    @Autowired
    private TestMapper testMapper;


    @DataSource(name = DataSourcesType.SLAVE)
    public List<Test>  index(){
        List<Test> list = testMapper.list();
        System.out.println(list);
        return  list;

        }

}